<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="jimageDetail.title"/></title>
    <meta name="heading" content="<fmt:message key='jimageDetail.heading'/>"/>
</head>

<s:form id="jimageForm" action="saveJimage" method="post" validate="true">
    <li style="display: none">
        <s:hidden key="jimage.id"/>
    </li>
    <s:textfield key="jimage.name" required="false" cssClass="text medium"/>
    <s:textfield key="jimage.size" required="false" cssClass="text medium"/>
    <s:textfield key="jimage.path" required="true" cssClass="text medium"/>
<li>
    <s:checkbox key="jimage.selected" cssClass="checkbox" theme="simple"/>
    <!-- For some reason, key prints out the raw value for the label (i.e. true) instead of the i18n key: https://issues.apache.org/struts/browse/WW-1958-->
    <s:label for="jimageForm_jimage_selected" value="%{getText('jimage.selected')}" cssClass="choice desc" theme="simple"/>
</li>
    <s:textfield key="jimage.newName" required="false" cssClass="text medium"/>
    <s:textfield key="jimage.uploadTime" required="false" cssClass="text" size="11" title="date"/>

    <li class="buttonBar bottom">
        <s:submit cssClass="button" method="save" key="button.save" theme="simple"/>
        <c:if test="${not empty jimage.id}">
            <s:submit cssClass="button" method="delete" key="button.delete"
                onclick="return confirmDelete('Jimage')" theme="simple"/>
        </c:if>
        <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
    </li>
</s:form>

<script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/calendar/calendar-setup.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/calendar/lang/calendar-en.js'/>"></script>
<script type="text/javascript">
    Form.focusFirstElement($("jimageForm"));
    Calendar.setup({inputField: "jimageForm_jimage_uploadTime", ifFormat: "%m/%d/%Y", button: "jimage.uploadTimeDatePicker"});
</script>
